﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;

using System.ServiceModel.Web;
using System.Text;
using MarsExplorerServer.Models;

namespace MarsExplorerServer
{
    // Define a service contract.
    [ServiceContract]    //(Namespace = "http://Microsoft.ServiceModel.Samples", SessionMode = SessionMode.Required,CallbackContract = typeof(ICalculatorDuplexCallback))
    public interface IService1
    {
        [OperationContract]
        string addResource(int TeamID, int ResourceID,int  value);

        [OperationContract]
        string GetData(int value);

        [OperationContract]
        MarsExplorerServer.CompositeType GetDataUsingDataContract(MarsExplorerServer.CompositeType composite);


        [OperationContract]
        Game getGame();

        [OperationContract]
        Team getTeam(int TeamID);

        [OperationContract]
        Player getPlayer(int PlayerID);


        // TODO: Add your service operations here
       [OperationContract]
        string createGame();

        // TODO: Add your service operations here
        [WebGet(ResponseFormat = WebMessageFormat.Json)]
        string ping(int value);

        // TODO: Add your service operations here
      [OperationContract]
        string addTeam(Team value);

        // TODO: Add your service operations here
       [OperationContract]
      string addPlayer(Team value);

        [WebGet(ResponseFormat = WebMessageFormat.Json)]
        MarsExplorerServer.CompositeType ping2(int value);
    }

    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get
            {
                return boolValue;
            }
            set
            {
                boolValue = value;
            }
        }

        [DataMember]
        public string StringValue
        {
            get
            {
                return stringValue;
            }
            set
            {
                stringValue = value;
            }
        }
    }

    public interface ICalculatorDuplexCallback
    {
       
        void Equals(string result);
       
        void message(string eqn);
    }
}
